package com.itcast.activiti.controller;


import cn.itcast.ic.common.bean.Response;
import com.itcast.activiti.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/redis")
public class RedisController {
    @Autowired
    private RedisUtils redisUtils;


    @GetMapping("/get/{key}")
    public Response getKey(@PathVariable("key") String key) {
        return Response.success(redisUtils.get(key));
    }

    @DeleteMapping("/del/{key}")
    public Response deleteRedis(@PathVariable("key") String key) {
        redisUtils.del(key);
        return Response.success(null);
    }


}

